<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <!-- 
        将两数组合并 并将合并后的数组首尾交换
     -->
</head>

<body>

</body>
<script>
    let arr1 = [1, 2, 5, 'guo', 'q', 'x', 0, 6];
    let arr2 = ['abc', '123', 8, 7, 6, '5px']
    let newArr = concat(arr1, arr2);
    // console.log(newArr);//合并后的数组
    console.log(newArr.reverse()); //首尾交换即翻转

    //数组合并函数，将arr2追加到arr1上
    function concat(arr1, arr2) {
        for (let i = 0; i < arr2.length; i++) {
            arr1.push(arr2[i]);
        }
        return arr1;
    }
</script>

</html>